<html>
<head> <title>Inscripciones Maratón</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojo/dojo.xd.js" djConfig="parseOnLoad: true">
        </script>
	<script>
			dojo.require("dijit.form.Form");
            dojo.require("dijit.form.Button");
            dojo.require("dijit.form.ValidationTextBox");
	</script>

	<script type="text/javascript">
   		dojo.require("dijit.form.Form");
            	dojo.require("dijit.form.Button");
            	dojo.require("dijit.form.ValidationTextBox");
	</script>
	<!--<link rel="stylesheet" href="style.css" type="text/css" /> -->
	<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dijit/themes/claro/claro.css"/>
</head>
<body>
<div dojoType="dijit.form.Form" id="contenedor" jsId="contenedor"encType="multipart/form-data" >
<script type="dojo/method" event="onSubmit">
			function sendForm(){
				var res = dojo.byId("formResp");
	
				dojo.xhrPost({
					url: "addteam.php",
					form: dojo.byId("contenedor"),
					load: function(content){
						dojo.style(res,"display","block");
						res.innerHTML = content;
					},
					error: function(){
						res.innerHTML = "Your form could not be sent";
					}
				});
			}
		            if (this.validate()) {
		                //return confirm('Form is valid, press OK to submit');
				return sendForm();
		            } else {
		                alert('Form contains invalid data.  Please correct first');
		                return false;
		            }
		            return true;
		  </script>
	<div id="cabecera"> <h3>Inscripciones X Maratón de Programación</h3> </div>

	<form id="form"> 
		Nombre del equipo:<br>
		<input type="text"  name="nameq" required="false" dojoType="dijit.form.ValidationTextBox"><br><br>
		Integrantes:<br><br>

		Integrante1<br>
		Nombre:<br>
		<input type="text" name="in1name"><br>
		Apellido:<br>
		<input type="text" name="in1ape"><br>
		<!--Cedula:<br>
		<input type="text" name="in1ced"><br> -->
		Email:<br>
		<input type="text" name="in1ema" required="false" dojoType="dijit.form.ValidationTextBox"
						 regExp="[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}" 
	  						promptMessage="Enter email address." invalidMessage="Invalid Email Address."/><br><br>
		
		
		
		Integrante2<br>
		Nombre:<br>
		<input type="text" name="in2name"><br>
		Apellido:<br>
		<input type="text" name="in2ape"><br>
		<!--Cedula:<br>
		<input type="text" name="in2ced"><br> -->
		Email:<br>
		<input type="text" name="in2ema"><br><br>

		Integrante3<br>
		Nombre:<br>
		<input type="text" name="in3name"><br>
		Apellido:<br>
		<input type="text" name="in3ape"><br>
		<!--Cedula:<br>
		<input type="text" name="in3ced"><br> -->
		Email:<br>
		<input type="text" name="in3ema"><br>
	</form>
	<br>
	<!--<button id="sendForm" onclick="sendForm();">Send Form</button>-->
	<button dojoType="dijit.form.Button" type="submit" name="submitButton"
		    value="Submit">
		        Submit
		    </button>
	<pre id="formResp"></pre>
</div>
</body>
</html>

